﻿using Caliburn.Micro;
using System.Collections.Generic;

namespace KouDai.WinPad.Models
{
    public class HotEntity : PropertyChangedBase
    {
        #region Fields
        private string _imageUrl = string.Empty;
        private string _rectColor = string.Empty;
        #endregion

        #region Constructor
        public HotEntity()
        {
            this.SubCateories = new List<HotEntity>();
            this.OriginalAppName = string.Empty;
            this.CombineAppId = string.Empty;
            this.OpenType = string.Empty;
        }
        #endregion

        #region Properties
        public string OriginalAppName { get; set; }
        public string CombineAppId { get; set; }
        public string OpenType { get; set; }
        public List<HotEntity> SubCateories { get; set; }

        public string ImageUrl
        {
            get { return _imageUrl; }
            set
            {
                if (value != _imageUrl)
                {
                    _imageUrl = value;
                    this.NotifyOfPropertyChange(() => ImageUrl);
                }
            }
        }

        public string RectColor
        {
            get
            {
                if (this.OriginalAppName.Equals("排行榜"))
                {
                    this.ImageUrl = "/Images/kd_hot_list.png";
                }
                return "#7F000000";
            }
            set
            {
                if (this._rectColor != value)
                {
                    _rectColor = value;
                    this.NotifyOfPropertyChange(() => RectColor);
                }
            }
        }
        #endregion
    }
}
